﻿using KZ.Express.ENT;
using KZ.Express.Task;
using KZ.Utilities;
using System;

namespace KZ.Express.Presenter
{
    public class PriceListPresenter : PresenterBase
    {
        private new PriceListTask _task;

        public PriceListPresenter(IViewBase view)
            : base(view, new PriceListENT())
        {
            _view = view;
            _task = new PriceListTask();
        }

        public override void LoadDataTable()
        {
            try
            {
                _view.SetMessage(String.Empty, true);
                _view.Table = _task.LoadDataTable(_view.Search);
            }
            catch (DataAccessException ex)
            {
                throw new BusinessLogicException(ex.Message);
            }
        }
    }
}